//
//  SubjectThreeLightVoiceHeadV.m
//  CoachsBook
//
//  Created by MaBookPro on 2022/8/24.
//

#import "SubjectThreeLightVoiceHeadV.h"

@implementation SubjectThreeLightVoiceHeadV


- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        
        [self CreateUI];
    }
    return self;
}
-(void)CreateUI{

    UIView *backV = [[UIView alloc]initWithFrame:CGRectMake(0, 0, APPwidth, 200)];
    backV.backgroundColor = [UIColor whiteColor];
    [self addSubview:backV];

    NSArray *OrderArr = @[@"组合指令",@"单项指令"];
    for (int i = 0; i < OrderArr.count; i++) {
        UIButton *orderBtn = [[UIButton alloc]initWithFrame:CGRectMake(APPwidth/2*i + APPwidth/38 *(5-3*i), 15, APPwidth/19 *6, 45)];
        [orderBtn setTitle:OrderArr[i] forState:0];
        [orderBtn setBackgroundColor:rgba(226, 239, 255, 1)];
        orderBtn.contentHorizontalAlignment = 0;
        [orderBtn setTitleColor:rgba(51, 51, 51, 1) forState:0];
        orderBtn.titleLabel.font = [UIFont systemFontOfSize:16];
        orderBtn.layer.cornerRadius = 45/2;
        [backV addSubview:orderBtn];
        if ( i == 0) {
            _zuhezhilingBtn = orderBtn;
        }else{
            _danxiangzhilingBtn = orderBtn;
        }
    }

    UIButton *rellybackBtn = [[UIButton alloc]initWithFrame:CGRectMake(15, backV.height-125, APPwidth-30, 105)];
    [rellybackBtn setTitle:@"" forState:0];
    rellybackBtn.contentHorizontalAlignment = 0;
    [rellybackBtn setBackgroundColor:rgba(245, 245, 250, 1)];
    [rellybackBtn setTitleColor:rgba(51, 51, 51, 1) forState:0];
    rellybackBtn.titleLabel.font = [UIFont systemFontOfSize:16];
    rellybackBtn.layer.cornerRadius = 45/2;
    [backV addSubview:rellybackBtn];

    UILabel *typeLab = [[UILabel alloc]initWithFrame:CGRectMake(65, 15, 55, 20)];
    typeLab.text = @"开始";
    typeLab.textColor = rgba(51, 51, 51, 1);
    typeLab.textAlignment = 1;
    typeLab.font = [UIFont boldSystemFontOfSize:14];
    [rellybackBtn addSubview:typeLab];
    
    
    UIImageView *circleimgv = [[UIImageView alloc]initWithFrame:CGRectMake(15, 35, 40, 40)];
    circleimgv.backgroundColor = [UIColor whiteColor];
    circleimgv.image = [UIImage imageNamed:@""];
    circleimgv.layer.cornerRadius = 40/2;
    circleimgv.backgroundColor = [UIColor blueColor];
    circleimgv.userInteractionEnabled = YES;
    [rellybackBtn addSubview:circleimgv];

    UILabel *titleLab = [[UILabel alloc]initWithFrame:CGRectMake(circleimgv.frame.size.width+circleimgv.frame.origin.x+20, 15, rellybackBtn.width-circleimgv.width-60, 65)];
    titleLab.text = @"下面将进行模拟夜间行驶场景灯光使用的考试操作，请按语音指令在5秒内做出相应的灯光操作，请开启前照灯。";
    titleLab.textColor = rgba(138, 138, 138, 1);
    titleLab.layer.backgroundColor = rgba(245, 245, 250, 1).CGColor;
    titleLab.textAlignment = 0;
    titleLab.numberOfLines = 0;
    titleLab.layer.cornerRadius = 10;
    titleLab.font = [UIFont systemFontOfSize:12];
    [rellybackBtn addSubview:titleLab];
    
}

@end
